package com.cloudbroker.bcs.csvc.uf30.api.constants.type;

import com.cloudbroker.bcs.common.util.ValueUtil;

/**
 * Created by xuyn15828 on 2016/5/21.
 */
public enum ActionIn {
    RECHARGE    ("1", "充值"),
    CONSUME     ("2", "消费"),
    ;

    private final String val;
    private final String description;

    ActionIn(String val, String description) {
        this.description = description;
        this.val = val;
    }

    public String getDescription() {
        return description;
    }

    public String getVal() {
        return val;
    }

    public static ActionIn keyOf(String action_in) {
        for(ActionIn actionIn : values()) {
            if(ValueUtil.getString(actionIn.getVal()).equals(action_in)) {
                return actionIn;
            }
        }
        return RECHARGE;
    }
}
